<?php
class Clase extends AppModel {
	var $name = 'Clase';
	var $useTable = 'clases';
	var $validate = array(
		'id' => array(
			'blank' => array(
				'rule' => array('blank'),
				'on' => 'create' 
			)
		),
		'grupo_id' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			),
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'instructor_id' => array(
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'comentario' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '500')
			)
		)
	);

	var $belongsTo = array(
		'Grupo' => array(
			'className' => 'Grupo',
			'foreignKey' => 'grupo_id'
		),
		'Instructor' => array(
			'className' => 'Persona',
			'foreignKey' => 'instructor_id'
		)
	);

	var $hasMany = array(
		'Inasistencia' => array(
			'className' => 'Inasistencia',
			'foreignKey' => 'clase_id'
		)
	);
}
?>